<template>
  <div>
    <van-nav-bar fixed title="收银详情" left-arrow @click-left="$utils.back($route.path);" />
    <div class="has-top">
      <div class="tac">
        <div class="br-full is-100 dis-inb mt-30">
          <img :src="headPortrait" alt="头像" />
        </div>
      </div>
      <p class="tac color-gray-light">{{RealName}}</p>
      <p class="tac fs-44 fw-600">{{payMoney}}</p>
      <p class="tac color-gray-light">交易成功</p>
      <div class="mg-30 bg-white pos-r ptb-50 plr-40 br-20">
        <div class="list">
          <div class="flex fs-28 mtb-30" v-for="(item,index) in payList" :key="index">
            <p class="color-gray-light pr-20 list-title">{{item.title}}</p>
            <p class>{{item.value}}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { GetCashierDetail } from 'api/order'
export default {
  data() {
    return {
      headPortrait: require('assets/images/defaultHeadPortrait.png'),
      RealName: '张三',
      payMoney: '-1000',
      payList: [],
      orderList: []
    }
  },
  computed: {},
  created() {
    // this.GetCashierDetail()
    let payList = this.payList,
      payListItem = {}
    payListItem.title = '转账类型'
    payListItem.value = '充值'
    payList.push(payListItem)
    payListItem = {}
    payListItem.title = '创建时间'
    payListItem.value = '2020-07-17 09:03:36'
    payList.push(payListItem)
    payListItem = {}
    payListItem.title = '账户余额'
    payListItem.value = '￥369.22'
    payList.push(payListItem)
    payListItem = {}
    payListItem.title = '转账备注'
    payListItem.value = '测试'
    payList.push(payListItem)
  },
  methods: {
    GetCashierDetail() {
      GetCashierDetail(this.$route.params.id).then(res => {
        if (res) {
          // this.recordList = res.Data
          console.log(res.Data)
          let data = res.Data,
            payList = this.payList,
            orderList = this.orderList,
            payListItem = {},
            orderListItem = {}

          this.payMoney = data.PayMoney
          this.RealName = data.RealName
          this.payMoney = data.PayMoney
          this.headPortrait = data.HeadPortrait
            ? $webInfo.ImgDomain + headValue.HeadPortrait
            : require('assets/images/defaultHeadPortrait.png')

          payListItem.title = '交易单号'
          payListItem.value = data.Sn
          payList.push(payListItem)
          payListItem = {}
          payListItem.title = '支付时间'
          payListItem.value = data.OrderTime
          payList.push(payListItem)
          payListItem = {}
          payListItem.title = '支付方式'
          payListItem.value = data.PayWayName
          payList.push(payListItem)

          orderListItem.title = '订单金额'
          orderListItem.value = data.PriceSum
          orderList.push(orderListItem)
          orderListItem = {}
          orderListItem.title = '优惠金额'
          orderListItem.value = data.CouponMoney
          orderList.push(orderListItem)
          orderListItem = {}
          orderListItem.title = '实付金额'
          orderListItem.value = data.PayMoney
          orderList.push(orderListItem)
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.list {
  div:last-child {
    padding-bottom: 40px;
  }
}
</style>
